<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"
%><%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"
%><%@ taglib prefix="security" uri="http://www.springframework.org/security/tags"
%><%@ taglib prefix="form" uri="http://www.springframework.org/tags/form"
%><%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"
%>
<head>
    <title><fmt:message key="contentContainer" /></title>
</head>
<body>
    <h1><fmt:message key="contentContainer" /></h1>
    <c:url var="createUrl" value="/domain/contentContainer/create.action"/>
    <form:form action="${createUrl}" id="contentContainerForm" modelAttribute="contentContainerForm" >
        <form:errors cssClass="error"/>
        <table>
            <form:hidden path="contentContainer.contentletInode"/>
            <tbody>
				<tr>
					<th>发布内容：${contentContainerForm.structureName}</th>
					<td>
					<c:url var="showContentUrl" value="/domain/contentlet/show.action">
						<c:param name="contentlet.inode" value="${contentContainerForm.contentContainer.contentletInode}" />
					</c:url>

					<a href="${showContentUrl}">
					<c:out value="${contentContainerForm.contentContainer.contentlet.title}" />
					</a>
					</td>
				</tr>

                <tr>
                    <th><fmt:message key="contentlet_folderInode" /></th>
                    <td>
						<c:url var="showContentUrl" value="/domain/folder/show.action">
							<c:param name="folder.inode" value="${contentContainerForm.contentContainer.contentlet.folderInode}" />
						</c:url>
						<a href="${showContentUrl}">
							<c:out value="${contentContainerForm.contentContainer.contentlet.folder.title}" />
						</a>
					</td>
                </tr>

                <tr>
                    <th><fmt:message key="contentContainer_folderInode" />*</th>
                    <td>
                        <form:select path="contentContainer.folderInode" items="${folderList}" itemLabel="title" itemValue="inode" />
                        <script type="text/javascript">
                            Spring.addDecoration(new Spring.ElementDecoration({
                                elementId : "contentContainer.folderInode",
                                widgetType : "dijit.form.FilteringSelect",
                                widgetAttrs : {
                                    required : true
                                }
                            }));
                        </script>
                        <form:errors cssClass="error" path="contentContainer.folderInode"/>
                    </td>
                </tr>

                <tr>
                    <th><fmt:message key="contentContainer_containerInode" /> *</th>
                    <td>
                        <form:select path="containerIds" items="${containersList}" itemLabel="title" itemValue="inode" />
                        <script type="text/javascript">
                            Spring.addDecoration(new Spring.ElementDecoration({
                                elementId : "containerIds",
                                widgetType : "dijit.form.MultiSelect",
                                widgetAttrs : {
                                    required : true
                                }
                            }));
                        </script>
                        <form:errors cssClass="error" path="containerIds"/>
                    </td>
                </tr>
                <tr>
                    <th><fmt:message key="contentContainer_showOnMenu" /></th>
                    <td>
                        <form:checkbox id="contentContainer.showOnMenu" path="contentContainer.showOnMenu"/>
                        <script type="text/javascript">
                            Spring.addDecoration(new Spring.ElementDecoration({
                                elementId : "contentContainer.showOnMenu",
                                widgetType : "dijit.form.CheckBox",
                                widgetAttrs : {
                                    checked: ${contentContainerForm.contentContainer.showOnMenu != null ? contentContainerForm.contentContainer.showOnMenu : false}
                                }
                            }));
                        </script>
                        <form:errors cssClass="error" path="contentContainer.showOnMenu"/>
                    </td>
                </tr>
                <tr>
                    <th><fmt:message key="contentContainer_sortOrder" /></th>
                    <td>
                        <form:input path="contentContainer.sortOrder"/>
                        <script type="text/javascript">
                            Spring.addDecoration(new Spring.ElementDecoration({
                                elementId : "contentContainer.sortOrder",
                                widgetType : "dijit.form.ValidationTextBox",
                                widgetAttrs : {
                                    required : false
                                    ,regExp : "[-+]?[0-9]+(\.[0-9]+)?"
                                }
                            }));
                        </script>
                        <form:errors cssClass="error" path="contentContainer.sortOrder"/>
                    </td>
                </tr>
                <tr>
                    <th><fmt:message key="contentContainer_itemPath" /></th>
                    <td>
                        <form:input path="contentContainer.itemPath"/>
                        <script type="text/javascript">
                            Spring.addDecoration(new Spring.ElementDecoration({
                                elementId : "contentContainer.itemPath",
                                widgetType : "dijit.form.ValidationTextBox",
                                widgetAttrs : {
                                    required : false
                                    ,regExp : "[-+]?[0-9]+(\.[0-9]+)?"
                                }
                            }));
                        </script>
                        <form:errors cssClass="error" path="contentContainer.itemPath"/>
                    </td>
                </tr>
                <tr>
                    <th><fmt:message key="contentContainer_beginTime" /></th>
                    <td>
                        <form:input path="contentContainer.beginTime"/>
                        <script type="text/javascript">
                            Spring.addDecoration(new Spring.ElementDecoration({
                                elementId : "contentContainer.beginTime",
                                widgetType : "dijit.form.DateTextBox",
                                widgetAttrs : {
                                    required : false
                                }
                            }));
                        </script>
                        <form:errors cssClass="error" path="contentContainer.beginTime"/>
                    </td>
                </tr>
                <tr>
                    <th><fmt:message key="contentContainer_endTime" /></th>
                    <td>
                        <form:input path="contentContainer.endTime"/>
                        <script type="text/javascript">
                            Spring.addDecoration(new Spring.ElementDecoration({
                                elementId : "contentContainer.endTime",
                                widgetType : "dijit.form.DateTextBox",
                                widgetAttrs : {
                                    required : false
                                }
                            }));
                        </script>
                        <form:errors cssClass="error" path="contentContainer.endTime"/>
                    </td>
                </tr>

            </tbody>
            <tfoot>
                <tr>
                    <td colspan="2">
                        <div class="buttons">
                            <button id="saveButton" class="ok" type="submit"><fmt:message key="label.form.submit"/></button>
                            <script type="text/javascript">
                                Spring.addDecoration(new Spring.ValidateAllDecoration({
                                    elementId:'saveButton',
                                    event:'onclick'
                                }));
                            </script>
                        </div>
                    </td>
                </tr>
            </tfoot>
        </table>
    </form:form>
</body>
